<?php
	DEFINE('H1', 'Make Table 4');
	DEFINE('TITLE','Make Table 4');
	require('includes/header.php');
?>	
	<h2><?PHP echo H1 ?></h2>
<?php
if (!isset($_POST['submit'])) {
?>
<form method="post" action="MakeTable4.php">
Rows: <br />
<input type="text" name="rows" value="<?php IF(isset($_POST['row'])) echo $POST['row'] ?>" /><br />
Cols: <br />
<input type="text" name="cols" value="<?php IF(isset($_POST['col'])) echo $POST['col'] ?>" />
<p>
<input type="checkbox" name="bors" id="bors" <?php if (isset($_POST['bors'])) {echo (' checked=\"checked\"');} ?> />Border</p>
<p>
<input type="submit" name="submit" value="Submit" />
</p>
</form>
<?php
} else {
?>
<form method="post" action="MakeTable4.php">
Rows: <br />
<input type="text" name="rows" value="<?php if(isset($_POST['rows'])) echo ($_POST['rows']) ?>" /><br />
Cols: <br />
<input type="text" name="cols" value="<?php if(isset($_POST['cols'])) echo ($_POST['cols']) ?>" />
<p>
<input type="checkbox" name="bors" id="bors" <?php if (isset($_POST['bors']))
             {echo (' checked=\"checked\"');} ?>" />Border</p>
<p>
<input type="submit" name="submit" value="Submit" />
</p>
</form>
<?php


$row = $_POST['rows'];
$col = $_POST['cols'];

if (!isset($_POST['bors'])) {
$bor = 0;
} 
else {
$bor = 1;
}


makeTable4($row, $col, $bor);

}


?>

<?php
	require('includes/footer.php');
?>